package com.booth.manage;

import com.alibaba.fastjson.JSON;
import com.booth.base.BaseConfig;
import com.booth.base.interceptor.UrlInterceptor;
import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;

public class ManageConfig extends BaseConfig{
    @Override
    public void configConstant(Constants arg0) {
        super.configConstant(arg0);
    }
    @Override
    public void configHandler(Handlers arg0) {
        super.configHandler(arg0);
    }
    @Override
    public void configInterceptor(Interceptors arg0) {
      super.configInterceptor(arg0);
    	System.out.println("aaaa=:"+JSON.toJSONString(arg0));
    	//arg0.add(new UrlInterceptor());
    }
    @Override
    public void configPlugin(Plugins arg0) {
        super.configPlugin(arg0);
        ActiveRecordPlugin arp = (ActiveRecordPlugin)arg0.getPluginList().get(1);
      
        
        arp.addMapping("booth","id" ,com.booth.manage.model.Booth.class);
        arp.addMapping("buss_opetator","id" ,com.booth.manage.model.BussOperator.class);
        arp.addMapping("booth_progress","id" ,com.booth.manage.model.BoothProgress.class);
        arp.addMapping("booth_pay_log","id" ,com.booth.manage.model.BoothPayLog.class);
        arp.addMapping("qr_code","id" ,com.booth.manage.model.QrCode.class);
    }
   
    

    @Override
    public void configRoute(Routes arg0) {
        super.configRoute(arg0);
        
        //arg0.add("/admin/ckeditor",com.booth.manage.controllers.CKEditorController.class);
        arg0.add("/admin/booth",com.booth.manage.controllers.BoothController.class,"/WEB-INF/pages/booth");
        arg0.add("/admin/bussOperator",com.booth.manage.controllers.BussOperatorController.class,"/WEB-INF/pages/booth");
        arg0.add("/admin/boothProgress",com.booth.manage.controllers.BoothProgressController.class,"/WEB-INF/pages/booth");
        arg0.add("/admin/boothPayLog",com.booth.manage.controllers.BoothPayLogController.class,"/WEB-INF/pages/booth");
        arg0.add("/admin/boothSublet",com.booth.manage.controllers.BoothSubletController.class,"/WEB-INF/pages/booth");
        arg0.add("/admin/boothCheck",com.booth.manage.controllers.BoothCheckController.class,"/WEB-INF/pages/booth");
        arg0.add("/admin/boothMy",com.booth.manage.controllers.BoothMyController.class,"/WEB-INF/pages/booth");
        arg0.add("/admin/qrCode",com.booth.manage.controllers.QrCodeController.class,"/WEB-INF/pages/booth");
        
    }
}
